We can make the turtle move the same distance using only 3 lines of code!

For Loops let you repeat a certain group of commands more than once.

The number in range() determines how many times the loop repeats.

  • The loop below only repeats 2 times. Change the for loop so that it repeats 4 times and completes the maze.

To navigate the page using the TAB key, first press ESC to exit the code editor.

# THIS ACTIVITY IS IN PREVIEW ONLY MODE
  • Run Code
  • Submit Work
  • Next Activity
  • Show Console
  • Reset Code Editor
  • Codesters How To (opens in a new tab)